package com.teacold.customdemo.customview;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.widget.TextView;

public class TouchText extends TextView {
    private Context mContext;
    private String TAG=this.getClass().getName();


    public TouchText(Context context) {
        this(context,null);
    }

    public TouchText(Context context, AttributeSet attrs) {
        this(context,attrs,0);
    }

    public TouchText(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs,defStyleAttr);
        mContext = context;
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        Log.e(TAG, "MyView onTouchEvent");
        switch (event.getAction()) {
            case MotionEvent.ACTION_DOWN:
                Log.e(TAG, "MyView onTouchEvent ACTION_DOWN");
                break;
            case MotionEvent.ACTION_MOVE:
                Log.e(TAG, "MyView onTouchEvent ACTION_MOVE");
                break;
            case MotionEvent.ACTION_CANCEL:
                Log.e(TAG, "MyView onTouchEvent ACTION_CANCEL");
                break;
            case MotionEvent.ACTION_UP:
                Log.e(TAG, "MyView onTouchEvent ACTION_UP");
                break;
            default:
                Log.e(TAG, "MyView onTouchEvent " + event.getAction());
                break;
        }
//        设置手势监听
        // mGesture.onTouchEvent(event);
        return super.onTouchEvent(event);
    }

    @Override
    public boolean dispatchTouchEvent(MotionEvent event) {
        Log.e(TAG, "MyView dispatchTouchEvent");
        return super.dispatchTouchEvent(event);
    }





}
